package cn.lzd.mr.case5;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * Created by lzd on 2018/6/1.
 */
public class Case5Partition extends Partitioner<Case5Bean, NullWritable> {

    @Override
    public int getPartition(Case5Bean key, NullWritable value, int numPartitions) {

        return (key.getOrderid().hashCode() & Integer.MAX_VALUE) % numPartitions;
    }

}
